import request from '@/utils/request'

// 查询列表
export function pageList(query) {
  return request({
    url: '/system/complaint/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 删除投诉
export function remove(userId) {
  return request({
    url: '/system/complaint/' + userId,
    method: 'delete',
    loading: true
  })
}

// 查询详细
export function getInfo(id) {
  return request({
    url: '/system/complaint/' + id,
    method: 'get',
    loading: true
  })
}

// 列表（分页）
export function categoryPageList(query) {
  return request({
    url: '/system/complaint/category/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 分类-新增
export function addCategory(data) {
  return request({
    url: '/system/complaint/category',
    method: 'post',
    loading: true,
    data: data
  })
}

// 分类-修改
export function editCategory(data) {
  return request({
    url: '/system/complaint/category',
    method: 'put',
    loading: true,
    data: data
  })
}

// 分类-详情
export function getCategoryInfo(id) {
  return request({
    url: '/system/complaint/category/' + id,
    method: 'get',
    loading: true
  })
}

// 分类-删除
export function removeCategory(id) {
  return request({
    url: '/system/complaint/category/' + id,
    method: 'delete',
    loading: true
  })
}

// 列表
export function categoryList(query) {
  return request({
    url: '/system/complaint/category/list',
    method: 'get',
    loading: true,
    params: query
  })
}

// 流转
export function circulation(data) {
  return request({
    url: '/system/complaint/circulation',
    method: 'post',
    loading: true,
    data: data
  })
}
